-- GENERATED SPELL FOR [Shadowmoon Weapon Master] --


function spell0_23049(pUnit, Event) --@Battle Aura,Self--
pUnit:FullCastSpellOnTarget(41106,pUnit)
pUnit:RegisterEvent('Sorts_23049', 661, 1)
end

function spell1_23049(pUnit, Event) --@Battle Stance,Self--
pUnit:FullCastSpellOnTarget(41099,pUnit)
pUnit:RegisterEvent('Sorts_23049', 564, 1)
end

function spell2_23049(pUnit, Event) --@Berserker Aura,Self--
pUnit:FullCastSpellOnTarget(41107,pUnit)
pUnit:RegisterEvent('Sorts_23049', 603, 1)
end

function spell3_23049(pUnit, Event) --@Berserker Stance,Self--
pUnit:FullCastSpellOnTarget(41100,pUnit)
pUnit:RegisterEvent('Sorts_23049', 611, 1)
end

function spell4_23049(pUnit, Event) --@Defensive Aura,Self--
pUnit:FullCastSpellOnTarget(41105,pUnit)
pUnit:RegisterEvent('Sorts_23049', 598, 1)
end

function spell5_23049(pUnit, Event) --@Defensive Stance,Self--
pUnit:FullCastSpellOnTarget(41101,pUnit)
pUnit:RegisterEvent('Sorts_23049', 606, 1)
end

function spell6_23049(pUnit, Event) --@Knock Away,n/a--
pUnit:FullCastSpellOnTarget(18813,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23049', 697, 1)
end

function spell7_23049(pUnit, Event) --@Mutilate,n/a--
pUnit:FullCastSpellOnTarget(41103,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23049', 617, 1)
end

function spell8_23049(pUnit, Event) --@Shield Wall,Self--
pUnit:FullCastSpellOnTarget(41104,pUnit)
pUnit:RegisterEvent('Sorts_23049', 10289, 1)
end

function spell9_23049(pUnit, Event) --@Whirlwind,n/a--
pUnit:FullCastSpellOnTarget(41097,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23049', 15000, 1)
end

function spell10_23049(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(41098,pUnit)
pUnit:RegisterEvent('Sorts_23049', 547, 1)
end

function Sorts_23049(pUnit, Event)
local choix_sorts_23049 = math.random(0, 10)
if choix_sorts_23049 == 0 then
pUnit:RegisterEvent('spell0_23049', 1, 1)
end
if choix_sorts_23049 == 1 then
pUnit:RegisterEvent('spell1_23049', 1, 1)
end
if choix_sorts_23049 == 2 then
pUnit:RegisterEvent('spell2_23049', 1, 1)
end
if choix_sorts_23049 == 3 then
pUnit:RegisterEvent('spell3_23049', 1, 1)
end
if choix_sorts_23049 == 4 then
pUnit:RegisterEvent('spell4_23049', 1, 1)
end
if choix_sorts_23049 == 5 then
pUnit:RegisterEvent('spell5_23049', 1, 1)
end
if choix_sorts_23049 == 6 then
pUnit:RegisterEvent('spell6_23049', 1, 1)
end
if choix_sorts_23049 == 7 then
pUnit:RegisterEvent('spell7_23049', 1, 1)
end
if choix_sorts_23049 == 8 then
pUnit:RegisterEvent('spell8_23049', 1, 1)
end
if choix_sorts_23049 == 9 then
pUnit:RegisterEvent('spell9_23049', 1, 1)
end
if choix_sorts_23049 == 10 then
pUnit:RegisterEvent('spell10_23049', 1, 1)
end
end

function mob23049_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23049', math.random(1500, 3000), 1)
end

function mob23049_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23049_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23049_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23049, 1, 'mob23049_Action')
RegisterUnitEvent(23049, 2, 'mob23049_Leave')
RegisterUnitEvent(23049, 3, 'mob23049_Kill')
RegisterUnitEvent(23049, 4, 'mob23049_Die')
